package net.nearst.oa.action;

import java.util.Map;

import net.nearst.oa.util.PagingBean;

import org.apache.struts2.interceptor.RequestAware;
import org.apache.struts2.interceptor.SessionAware;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.opensymphony.xwork2.ActionSupport;

public class BaseAction extends ActionSupport implements RequestAware,
		SessionAware {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String successResultValue;

	protected Gson gson ;
	
	protected String jsonString ;
	
	protected PagingBean pagingBean ;
	
	public String getJsonString() {
		return jsonString;
	}
	public void setJsonString(String jsonString) {
		this.jsonString = jsonString;
	}
	public BaseAction() {
		gson = new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss")
						.setPrettyPrinting()
						.create();
		successResultValue="/jsonString.jsp" ;
	}
	public String getSuccessResultValue() {
		return successResultValue;
	}

	public void setSuccessResultValue(String successResultValue) {
		this.successResultValue = successResultValue;
	}

	public Map request;

	public Map session;

	@Override
	public void setSession(Map<String, Object> arg0) {
		// TODO Auto-generated method stub
		this.session = arg0 ;
	}
	
	@Override
	public void setRequest(Map<String, Object> arg0) {
		// TODO Auto-generated method stub
		this.request = arg0 ;
	}
	
	public PagingBean getPagingBean() {
		return pagingBean;
	}
	
	public void setPagingBean(PagingBean pagingBean) {
		this.pagingBean = pagingBean;
	}

}
